package com.ruoyi.service.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.service.entity.rule.RuleVO;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 接单退单规则对象 service_rule
 * 
 * @author ZDL
 * @date 2025-03-10
 */
public class ServiceRule extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 接退单表主键ID */
    private Long ruleId;

    /** 0 接单规则 1 退单规则 */
    @Excel(name = "0 接单规则 1 退单规则")
    private String ruleType;

    /** 提前预约时间 */
    @Excel(name = "提前预约时间")
    private Integer ruleHour;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private Integer ruleFlag;

    /** 退费比率 */
    @Excel(name = "退费比率")
    private Double ruleRefund;

    /** 0 启用 2禁用 */
    @Excel(name = "0 启用 2禁用")
    private String ruleUseFlag;

    /** 0 正常 2 删除 */
    @Excel(name = "0 正常 2 删除")
    private String ruleDelFlag;

    /** 创建者 */
    @Excel(name = "创建者")
    private String ruleCreateBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date ruleCreateTime;

    /** 更新者 */
    @Excel(name = "更新者")
    private String ruleUpdateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date ruleUpdateTime;

    /** 备注 */
    @Excel(name = "备注")
    private String ruleRemark;

    public void setRuleId(Long ruleId) 
    {
        this.ruleId = ruleId;
    }

    public Long getRuleId() 
    {
        return ruleId;
    }
    public void setRuleType(String ruleType) 
    {
        this.ruleType = ruleType;
    }

    public String getRuleType() 
    {
        return ruleType;
    }
    public void setRuleHour(Integer ruleHour) 
    {
        this.ruleHour = ruleHour;
    }

    public Integer getRuleHour() 
    {
        return ruleHour;
    }
    public void setRuleFlag(Integer ruleFlag) 
    {
        this.ruleFlag = ruleFlag;
    }

    public Integer getRuleFlag() 
    {
        return ruleFlag;
    }
    public void setRuleRefund(Double ruleRefund)
    {
        this.ruleRefund = ruleRefund;
    }

    public Double getRuleRefund()
    {
        return ruleRefund;
    }
    public void setRuleUseFlag(String ruleUseFlag) 
    {
        this.ruleUseFlag = ruleUseFlag;
    }

    public String getRuleUseFlag() 
    {
        return ruleUseFlag;
    }
    public void setRuleDelFlag(String ruleDelFlag) 
    {
        this.ruleDelFlag = ruleDelFlag;
    }

    public String getRuleDelFlag() 
    {
        return ruleDelFlag;
    }
    public void setRuleCreateBy(String ruleCreateBy) 
    {
        this.ruleCreateBy = ruleCreateBy;
    }

    public String getRuleCreateBy() 
    {
        return ruleCreateBy;
    }
    public void setRuleCreateTime(Date ruleCreateTime) 
    {
        this.ruleCreateTime = ruleCreateTime;
    }

    public Date getRuleCreateTime() 
    {
        return ruleCreateTime;
    }
    public void setRuleUpdateBy(String ruleUpdateBy) 
    {
        this.ruleUpdateBy = ruleUpdateBy;
    }

    public String getRuleUpdateBy() 
    {
        return ruleUpdateBy;
    }
    public void setRuleUpdateTime(Date ruleUpdateTime) 
    {
        this.ruleUpdateTime = ruleUpdateTime;
    }

    public Date getRuleUpdateTime() 
    {
        return ruleUpdateTime;
    }
    public void setRuleRemark(String ruleRemark) 
    {
        this.ruleRemark = ruleRemark;
    }

    public String getRuleRemark() 
    {
        return ruleRemark;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("ruleId", getRuleId())
            .append("ruleType", getRuleType())
            .append("ruleHour", getRuleHour())
            .append("ruleFlag", getRuleFlag())
            .append("ruleRefund", getRuleRefund())
            .append("ruleUseFlag", getRuleUseFlag())
            .append("ruleDelFlag", getRuleDelFlag())
            .append("ruleCreateBy", getRuleCreateBy())
            .append("ruleCreateTime", getRuleCreateTime())
            .append("ruleUpdateBy", getRuleUpdateBy())
            .append("ruleUpdateTime", getRuleUpdateTime())
            .append("ruleRemark", getRuleRemark())
            .toString();
    }

    public void init(RuleVO serviceRule) {

        this.ruleId = serviceRule.getRuleId();
        this.ruleType = serviceRule.getRuleType();
        this.ruleHour = serviceRule.getRuleHour();

        this.ruleRefund = serviceRule.getRuleRefund();
        this.ruleUseFlag = serviceRule.getRuleUseFlag();
        this.ruleDelFlag = serviceRule.getRuleDelFlag();
        this.ruleCreateBy = serviceRule.getRuleCreateBy();
        this.ruleCreateTime = serviceRule.getRuleCreateTime();
        this.ruleUpdateBy = serviceRule.getRuleUpdateBy();
        this.ruleUpdateTime = serviceRule.getRuleUpdateTime();
        this.ruleRemark = serviceRule.getRuleRemark();
    }
}
